<? $attributes = array('class' => 'email', 'id' => 'checknew');
    echo form_open('tuvan/dels', $attributes);?>
<table class="admindata" width="100%">
    <thead>
        <tr>
            <th colspan="5"> <input type="submit" onclick="return verify_del();" name="btn_submit" value="Xóa">
                Hiện có
                <?=$num?>
                bài viết
                <?=$pagination?>
            </th>
        </tr>
        <tr>
            <th class="checkbox"><input type="checkbox" name="sa" id="sa" onclick="check_chose('sa', 'ar_id[]', 'checknew')" /></th>
            <th>Người gởi</th>
            <th>Nội dung</th>
            <th class="publish">Ngày gởi</th>
            <th class="publish">Chức năng</th>
        </tr>
    </thead>
    <?
        $k=1;
        $i=1;
		
        foreach($list as $rs):
			$content= !empty($rs->lb_content_vn) ? $rs->lb_content_vn : $rs->lb_content_en;
			$lb_content = str_limit($content,200);
			$bold = empty($rs->is_read)? 'bold' : '' ;
        ?>            
        <tr class="row<?=$k?> <?=$bold?>">
            <td><input type="checkbox" name="ar_id[]" value="<?=$rs->tv_id?>"></td>
            <td><?=$rs->lb_cusname ?><br /><?=$rs->lb_cusmail ?><br /></td>
            <td><?=$lb_content?></td>
            <td align="center"><?=datevn($rs->dt_create)?></td>
            <td align="center">
                <?=icon_edit('tuvan/editanser/'.$rs->tv_id)?>
                <?//=icon_view('tuvan/view/'.$rs->tv_id)?>
                <span id="publish<?=$rs->tv_id?>"> <?=icon_active("'tuvan'","'tv_id'",$rs->tv_id,$rs->bl_active)?> </span>
                <?=icon_del('tuvan/del/'.$rs->tv_id.'/'.$start)?></td>
        </tr>
			<?php 
                $this->load->model('tuvan_model', 'tuvan') ;
                $arrGetList=$this->tuvan->get_list($per_page,$start,$rs->tv_id);
                if(count($arrGetList)>0){
					foreach($arrGetList as $row2)
					{
							$content2=!empty($row2->lb_content_vn) ? $row2->lb_content_vn : $row2->lb_content_en;
							$lb_content = ($row2->is_ans==1) ? 'Trả lời:':'';
							
							$lb_content.=str_limit($content2,200);
					?>
						<tr class="row<?=$k?>">
						<td><input type="checkbox" name="ar_id[]" value="<?=$row2->tv_id?>"></td>
						<td><?=$row2->lb_cusname ?><br /></td>
						<td><?=$lb_content?></td>
						<td align="center"><?=datevn($row2->dt_create)?></td>
						<td align="center">
							<?=icon_edit('tuvan/editanser/'.$row2->tv_id)?>
							<?//=icon_view('tuvan/view/'.$row2->tv_id)?>
							<span id="publish<?=$row2->tv_id?>"> <?=icon_active("'tuvan'","'tv_id'",$row2->tv_id,$row2->bl_active)?> </span>
							<?=icon_del('tuvan/del/'.$row2->tv_id.'/'.$start)?></td>
					</tr>
					<?php 
				}
			}?>
	<?
        $k=1-$k;
        $i++;
        endforeach;
	?>
    <tfoot>
    <td colspan="5"><input type="submit" onclick="return verify_del();" name="btn_submit" value="Xóa">
    Hiện có  <?=$num?> bài viết <?=$pagination?></td>
    </tfoot>
</table>
<?=form_close()?>